\(\int \frac {A+B \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \, dx\) [833]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 45, antiderivative size = 92 \[ \int \frac {A+B \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \, dx=-\frac {i A+B}{f \sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}}+\frac {i A \sqrt {c-i c \tan (e+f x)}}{c f \sqrt {a+i a \tan (e+f x)}} \]

[Out]

(-I*A-B)/f/(a+I*a*tan(f*x+e))^(1/2)/(c-I*c*tan(f*x+e))^(1/2)+I*A*(c-I*c*tan(f*x+e))^(1/2)/c/f/(a+I*a*tan(f*x+e
))^(1/2)

Rubi [A] (verified)

Time = 0.22 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {3669, 79, 37} \[ \int \frac {A+B \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \, dx=\frac {i A \sqrt {c-i c \tan (e+f x)}}{c f \sqrt {a+i a \tan (e+f x)}}-\frac {B+i A}{f \sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \]

[In]

Int[(A + B*Tan[e + f*x])/(Sqrt[a + I*a*Tan[e + f*x]]*Sqrt[c - I*c*Tan[e + f*x]]),x]

[Out]

-((I*A + B)/(f*Sqrt[a + I*a*Tan[e + f*x]]*Sqrt[c - I*c*Tan[e + f*x]])) + (I*A*Sqrt[c - I*c*Tan[e + f*x]])/(c*f
*Sqrt[a + I*a*Tan[e + f*x]])

Rule 37

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n +
1)/((b*c - a*d)*(m + 1))), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[m + n + 2, 0] && NeQ
[m, -1]

Rule 79

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(-(b*e - a*f
))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1
) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e,
f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || L
tQ[p, n]))))

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^{3/2} (c-i c x)^{3/2}} \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {i A+B}{f \sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}}+\frac {(a A) \text {Subst}\left (\int \frac {1}{(a+i a x)^{3/2} \sqrt {c-i c x}} \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {i A+B}{f \sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}}+\frac {i A \sqrt {c-i c \tan (e+f x)}}{c f \sqrt {a+i a \tan (e+f x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.49 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.54 \[ \int \frac {A+B \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \, dx=\frac {-B+A \tan (e+f x)}{f \sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \]

[In]

Integrate[(A + B*Tan[e + f*x])/(Sqrt[a + I*a*Tan[e + f*x]]*Sqrt[c - I*c*Tan[e + f*x]]),x]

[Out]

(-B + A*Tan[e + f*x])/(f*Sqrt[a + I*a*Tan[e + f*x]]*Sqrt[c - I*c*Tan[e + f*x]])

Maple [A] (verified)

Time = 0.47 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.00

method result size
risch \(-\frac {i A \,{\mathrm e}^{2 i \left (f x +e \right )}+B \,{\mathrm e}^{2 i \left (f x +e \right )}-i A +B}{2 \sqrt {\frac {a \,{\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}}\, \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) \sqrt {\frac {c}{{\mathrm e}^{2 i \left (f x +e \right )}+1}}\, f}\) \(92\)
derivativedivides \(\frac {\sqrt {a \left (1+i \tan \left (f x +e \right )\right )}\, \sqrt {-c \left (i \tan \left (f x +e \right )-1\right )}\, \left (A \tan \left (f x +e \right )^{3}-B \tan \left (f x +e \right )^{2}+A \tan \left (f x +e \right )-B \right )}{f a c \left (i+\tan \left (f x +e \right )\right )^{2} \left (i-\tan \left (f x +e \right )\right )^{2}}\) \(99\)
default \(\frac {\sqrt {a \left (1+i \tan \left (f x +e \right )\right )}\, \sqrt {-c \left (i \tan \left (f x +e \right )-1\right )}\, \left (A \tan \left (f x +e \right )^{3}-B \tan \left (f x +e \right )^{2}+A \tan \left (f x +e \right )-B \right )}{f a c \left (i+\tan \left (f x +e \right )\right )^{2} \left (i-\tan \left (f x +e \right )\right )^{2}}\) \(99\)
parts \(\frac {A \sqrt {a \left (1+i \tan \left (f x +e \right )\right )}\, \sqrt {-c \left (i \tan \left (f x +e \right )-1\right )}\, \left (1+\tan \left (f x +e \right )^{2}\right ) \tan \left (f x +e \right )}{f a c \left (i-\tan \left (f x +e \right )\right )^{2} \left (i+\tan \left (f x +e \right )\right )^{2}}+\frac {B \left (-\tan \left (f x +e \right )^{2}-1\right ) \sqrt {-c \left (i \tan \left (f x +e \right )-1\right )}\, \sqrt {a \left (1+i \tan \left (f x +e \right )\right )}}{f c a \left (i-\tan \left (f x +e \right )\right )^{2} \left (i+\tan \left (f x +e \right )\right )^{2}}\) \(162\)

[In]

int((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^(1/2)/(c-I*c*tan(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2/(a*exp(2*I*(f*x+e))/(exp(2*I*(f*x+e))+1))^(1/2)/(exp(2*I*(f*x+e))+1)/(c/(exp(2*I*(f*x+e))+1))^(1/2)*(I*A*
exp(2*I*(f*x+e))+B*exp(2*I*(f*x+e))-I*A+B)/f

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.24 \[ \int \frac {A+B \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \, dx=\frac {{\left ({\left (-i \, A - B\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, B e^{\left (3 i \, f x + 3 i \, e\right )} - 2 \, B e^{\left (2 i \, f x + 2 i \, e\right )} + 2 \, B e^{\left (i \, f x + i \, e\right )} + i \, A - B\right )} \sqrt {\frac {a}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} e^{\left (-i \, f x - i \, e\right )}}{2 \, a c f} \]

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^(1/2)/(c-I*c*tan(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

1/2*((-I*A - B)*e^(4*I*f*x + 4*I*e) + 2*B*e^(3*I*f*x + 3*I*e) - 2*B*e^(2*I*f*x + 2*I*e) + 2*B*e^(I*f*x + I*e)
+ I*A - B)*sqrt(a/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(c/(e^(2*I*f*x + 2*I*e) + 1))*e^(-I*f*x - I*e)/(a*c*f)

Sympy [F]

\[ \int \frac {A+B \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \, dx=\int \frac {A + B \tan {\left (e + f x \right )}}{\sqrt {i a \left (\tan {\left (e + f x \right )} - i\right )} \sqrt {- i c \left (\tan {\left (e + f x \right )} + i\right )}}\, dx \]

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))**(1/2)/(c-I*c*tan(f*x+e))**(1/2),x)

[Out]

Integral((A + B*tan(e + f*x))/(sqrt(I*a*(tan(e + f*x) - I))*sqrt(-I*c*(tan(e + f*x) + I))), x)

Maxima [A] (verification not implemented)

none

Time = 0.39 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.35 \[ \int \frac {A+B \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \, dx=-\frac {2 \, {\left ({\left (A - i \, B\right )} \cos \left (4 \, f x + 4 \, e\right ) - 2 i \, B \cos \left (2 \, f x + 2 \, e\right ) - {\left (-i \, A - B\right )} \sin \left (4 \, f x + 4 \, e\right ) + 2 \, B \sin \left (2 \, f x + 2 \, e\right ) - A - i \, B\right )} \sqrt {a} \sqrt {c}}{-4 \, {\left (i \, a c \cos \left (3 \, f x + 3 \, e\right ) + i \, a c \cos \left (f x + e\right ) - a c \sin \left (3 \, f x + 3 \, e\right ) - a c \sin \left (f x + e\right )\right )} f} \]

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^(1/2)/(c-I*c*tan(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

-2*((A - I*B)*cos(4*f*x + 4*e) - 2*I*B*cos(2*f*x + 2*e) - (-I*A - B)*sin(4*f*x + 4*e) + 2*B*sin(2*f*x + 2*e) -
 A - I*B)*sqrt(a)*sqrt(c)/((-4*I*a*c*cos(3*f*x + 3*e) - 4*I*a*c*cos(f*x + e) + 4*a*c*sin(3*f*x + 3*e) + 4*a*c*
sin(f*x + e))*f)

Giac [F]

\[ \int \frac {A+B \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \, dx=\int { \frac {B \tan \left (f x + e\right ) + A}{\sqrt {i \, a \tan \left (f x + e\right ) + a} \sqrt {-i \, c \tan \left (f x + e\right ) + c}} \,d x } \]

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^(1/2)/(c-I*c*tan(f*x+e))^(1/2),x, algorithm="giac")

[Out]

integrate((B*tan(f*x + e) + A)/(sqrt(I*a*tan(f*x + e) + a)*sqrt(-I*c*tan(f*x + e) + c)), x)

Mupad [B] (verification not implemented)

Time = 0.80 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.55 \[ \int \frac {A+B \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)} \sqrt {c-i c \tan (e+f x)}} \, dx=-\frac {\sqrt {\frac {a\,\left (\cos \left (2\,e+2\,f\,x\right )+1+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,e+2\,f\,x\right )+1}}\,\left (A\,1{}\mathrm {i}+B-A\,\cos \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}+B\,\cos \left (2\,e+2\,f\,x\right )-A\,\sin \left (2\,e+2\,f\,x\right )-B\,\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{2\,a\,f\,\sqrt {\frac {c\,\left (\cos \left (2\,e+2\,f\,x\right )+1-\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,e+2\,f\,x\right )+1}}} \]

[In]

int((A + B*tan(e + f*x))/((a + a*tan(e + f*x)*1i)^(1/2)*(c - c*tan(e + f*x)*1i)^(1/2)),x)

[Out]

-(((a*(cos(2*e + 2*f*x) + sin(2*e + 2*f*x)*1i + 1))/(cos(2*e + 2*f*x) + 1))^(1/2)*(A*1i + B - A*cos(2*e + 2*f*
x)*1i + B*cos(2*e + 2*f*x) - A*sin(2*e + 2*f*x) - B*sin(2*e + 2*f*x)*1i))/(2*a*f*((c*(cos(2*e + 2*f*x) - sin(2
*e + 2*f*x)*1i + 1))/(cos(2*e + 2*f*x) + 1))^(1/2))